home *** CD-ROM | disk | FTP | other *** search
-
-
- #ifndef FRFUNERALCAR_H
- #define FRFUNERALCAR_H
-
- #include "FRCar.h"
-
- class FRFuneralCar : public FRCar
- {
- TERTTIDeclaration;
-
- public:
-
- FRFuneralCar(TEVector &rCenter, Float fInitYRot)
- {
- TEOBoundingBox *pOBox = new TEOBoundingBox;
- TEAABoundingBox BBox;
- TEVector Min, Max;
- TEEngine *pEngine = TEEngine::GetEngine();
- TESoundManager* pSound = TESoundManager::GetSoundManager();
- TEString Name;
-
- Name = "motor4.ogg";
- m_pMotor = pSound->GetSound(Name);
- Name = "brake.ogg";
- m_pBraking = pSound->GetSound(Name);
- Name = "horn1.ogg";
- m_pHorn = pSound->GetSound(Name);
-
- m_fMass = 2500.0f;
-
- m_fMaxRPM = 5000.0f;
- m_fRotFactor = 90.0f;
-
- m_ulNumGears = 6;
- m_aGears = new FRGearInfo[6];
-
- m_aGears[0].fRPMChange = 3500.0f;
- m_aGears[0].fRPMTrans = -100.0f;
- m_aGears[1].fRPMChange = 3000.0f;
- m_aGears[1].fRPMTrans = 95.0f;
- m_aGears[2].fRPMChange = 2000.0f;
- m_aGears[2].fRPMTrans = 120.0f;
- m_aGears[3].fRPMChange = 500.0f;
- m_aGears[3].fRPMTrans = 250.0f;
- m_aGears[4].fRPMChange = 200.0f;
- m_aGears[4].fRPMTrans = 400.0f;
- m_aGears[5].fRPMChange = 50.0f;
- m_aGears[5].fRPMTrans = 475.0f;
-
- m_Center = m_OldCenter = rCenter;
- m_Rotation = TEVector(0.0f, fInitYRot, 0.0f);
-
- m_pModelRef = TEModelManager::GetModelManager()->GetModel("funeralcar.tmf");
- TEAssert(m_pModelRef);
-
- m_pModelRef->SetAnimation(0);
- m_pModelRef->SetTimeScale(0);
- m_pModelRef->SetLoopAnimation(true);
-
- BBox = m_pModelRef->GetModelBBox();
- BBox.GetData(Min, Max);
- m_CarSize = Max - Min;
-
- m_Center.m_fX = m_OldCenter.m_fX = rCenter.m_fX;
- m_Center.m_fY = m_OldCenter.m_fY = m_fDeltaY = TEAbs(Min.m_fY) + 0.05f;
- m_Center.m_fZ = m_OldCenter.m_fZ = rCenter.m_fZ;
-
- pOBox->SetData(m_Center, Min, Max, m_Rotation);
-
- m_pBoundingVolume = pOBox;
-
- m_fFrontAxis = 0.0f;
- m_fRearAxis = -38.0f;
-
- m_fWheelWidth = 5.0f;
- m_fWheelMov = 1.75f;
-
- m_aLightPos[0] = TEVector(-7.50f, 0.0f, 31.25f);
- m_aLightPos[1] = TEVector( 7.50f, 0.0f, 31.25f);
- m_aLightPos[2] = TEVector(-7.75f, -1.5f, -30.0f);
- m_aLightPos[3] = TEVector( 7.75f, -1.5f, -30.0f);
-
- m_fBrakeEfficiency = 14.0f;
-
- UpdateVectors();
-
- if(ms_bSmoke)
- {
- TEVector Center = m_pBoundingVolume->GetCenter();
- TEVector Tmp = Center + m_aExhaustPos[0].m_fX * m_Right +
- m_aExhaustPos[0].m_fY * m_Up + m_aExhaustPos[0].m_fZ * m_Forward;
-
- m_usNumExhaust = 1;
- m_aExhaustPos[0] = TEVector(5.5f, -4.5f, -32.5f);
-
- m_aExhaust[0] = new TEParticleFX(Tmp, 2, 4, 1.2f, 0, 0, 0, m_Up, 250, 1000,
- 255, 1.0f, true, false);
-
- m_aExhaust[0]->SetColor(255, 255, 255);
-
- pEngine->AddParticleSystem(m_aExhaust[0]);
- }
-
- if(m_pMotor != NULL)
- m_pMotor->Play3D(m_Center, m_Velocity, TESOUND_LOOP, 1.0f);
-
- m_bTransparency = true;
- }
- };
-
- #endif